home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 114 / PC Guia 114.iso / Software / Utils / The Gimp 2.2.1 / gimp-help-2-0.6-setup.exe / {app} / share / gimp / 2.0 / help / en / ch02s09.html < prev    next >
Encoding:
Extensible Markup Language  |  2004-12-19  |  18.6 KB  |  538 lines

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.   <head>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6.     <title>9.┬áUsing Script-Fu Scripts</title>
  7.     <link rel="stylesheet" href="gimp-help-plain.css" type="text/css" />
  8.     <link rel="stylesheet" href="gimp-help-screen.css" type="text/css" />
  9.     <meta name="generator" content="DocBook XSL Stylesheets V1.66.1" />
  10.     <link rel="start" href="index.html" title="GIMP User Manual" />
  11.     <link rel="up" href="ch02.html" title="Chapter┬á2.┬áUsing Gimp" />
  12.     <link rel="prev" href="ch02s08s04.html" title="8.4.┬áWriting Plugins" />
  13.     <link rel="next" href="ch02s10.html" title="10.┬áA Script-Fu Tutorial" />
  14.   </head>
  15.   <body>
  16.     <div xmlns="" class="navheader">
  17.       <table width="100%" summary="Navigation header">
  18.         <tr>
  19.           <th colspan="3" align="center" id="chaptername">Chapter┬á2.┬áUsing <span xmlns="http://www.w3.org/1999/xhtml" class="acronym">Gimp</span></th>
  20.         </tr>
  21.         <tr>
  22.           <td width="20%" align="left"><a accesskey="p" href="ch02s08s04.html">Prev</a>┬á</td>
  23.           <th width="60%" align="center" id="sectionname">9.┬áUsing Script-Fu Scripts</th>
  24.           <td width="20%" align="right">┬á<a accesskey="n" href="ch02s10.html">Next</a></td>
  25.         </tr>
  26.       </table>
  27.       <hr />
  28.     </div>
  29.     <div class="sect1" lang="en" xml:lang="en">
  30.       <div class="titlepage">
  31.         <div>
  32.           <div>
  33.             <h2 class="title" style="clear: both"><a id="gimp-using-script-fu"></a>9.┬áUsing Script-Fu Scripts</h2>
  34.           </div>
  35.         </div>
  36.       </div>
  37.       <a id="id3428492" class="indexterm"></a>
  38.       <div class="simplesect" lang="en" xml:lang="en">
  39.         <div class="titlepage">
  40.           <div>
  41.             <div>
  42.               <h3 class="title"><a id="id3428506"></a>Script-Fu?</h3>
  43.             </div>
  44.           </div>
  45.         </div>
  46.         <p>
  47.       Script-Fu is what the Windows world would call "macros" But
  48.       Script-Fu is more powerful than that. Script-Fu is based on an
  49.       interpreting language called Scheme, and works by using querying
  50.       functions to the Gimp database. You can do all kinds of things
  51.       with Script-Fu, but an ordinary Gimp user will probably use it
  52.       for automating things that:  
  53.     </p>
  54.         <div class="itemizedlist">
  55.           <ul type="disc">
  56.             <li>
  57.               <p>
  58.         You want to do frequently.
  59.       </p>
  60.             </li>
  61.             <li>
  62.               <p>
  63.         Are really complicated to do, and hard to remember.
  64.       </p>
  65.             </li>
  66.           </ul>
  67.         </div>
  68.         <p>
  69.       Remember that you can do a whole lot with Script-Fu. The
  70.       scripts that come with Gimp can be quite useful, but they can
  71.       also serve as models for learning Script-Fu, or at least as a
  72.       framework and source of modification when you make your own
  73.       script. Read the Script-Fu Tutorial in the next section
  74.       if you want to learn more about how to make scripts. 
  75.     </p>
  76.         <p>
  77.       We will describe some of the most useful scripts in this
  78.       chapter, but we won't cover them all. There are simply too many
  79.       scripts. Some of the scripts are also very simple and you will
  80.       probably not need any documentation to be able to use them. 
  81.     </p>
  82.         <p>
  83.       Script-Fu (a dialect of Scheme) isn't the only scripting
  84.       language available for Gimp. But Script-Fu is the only scripting
  85.       language that is installed by default. Other available scripting
  86.       extensions are Perl and Tcl. You can download and install both
  87.       extensions at the <a href="http://registry.gimp.org" target="_top">Gimp
  88.       Plugin Registry</a>. 
  89.     </p>
  90.       </div>
  91.       <div class="simplesect" lang="en" xml:lang="en">
  92.         <div class="titlepage">
  93.           <div>
  94.             <div>
  95.               <h3 class="title"><a id="id3428576"></a>Installing Script-Fus</h3>
  96.             </div>
  97.           </div>
  98.         </div>
  99.         <p>
  100.       One of the great things about Script-Fu is that you can share your
  101.       script with all your Gimp friends. There are many scripts
  102.       that come with Gimp by default, but there are also vast
  103.       quantities of scripts that
  104.       are available for download all around the Internet. 
  105.     </p>
  106.         <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
  107.           <table border="0" summary="Tip">
  108.             <tr>
  109.               <td rowspan="2" align="center" valign="top" width="25">
  110.                 <img alt="[Tip]" src="../images/tip.png" />
  111.               </td>
  112.               <th align="left">Tip</th>
  113.             </tr>
  114.             <tr>
  115.               <td colspan="2" align="left" valign="top">
  116.                 <p>
  117.         If you have downloaded a script, copy or move your new script to
  118.         your <tt class="filename">.gimp-2.0/scripts</tt> directory and do a
  119.         refresh. The script will now appear in one of your menus. If you
  120.         don't find it, look for it under the root file menu filters. If it
  121.         doesn't appear at all, something was wrong with the script. 
  122.       </p>
  123.               </td>
  124.             </tr>
  125.           </table>
  126.         </div>
  127.         <p>
  128.       Note that you can't use more than one Script-Fu dialog at a
  129.       time, so don't open a script and one more after that. The last
  130.       one will never be opened and displayed. 
  131.     </p>
  132.       </div>
  133.       <div class="simplesect" lang="en" xml:lang="en">
  134.         <div class="titlepage">
  135.           <div>
  136.             <div>
  137.               <h3 class="title"><a id="id3428619"></a>Do's and Don'ts</h3>
  138.             </div>
  139.           </div>
  140.         </div>
  141.         <p>
  142.       A common error when you are dealing with Script-Fus is that you
  143.       simply bring them up and press the OK button. When nothing
  144.       happens, you probably think that the script is broken or buggy,
  145.       but there is most likely nothing wrong with it. 
  146.     </p>
  147.         <p>
  148.       Think again. Did you really read the information in the dialog,
  149.       or did you just press the button? If you forgot an input the
  150.       script needs, or if you gave it the wrong input, the script will
  151.       fail. One of the most common errors is that the font specified
  152.       in the script dialog hasn't been installed on your system. So
  153.       please check the information in the dialog before blaming the
  154.       script. 
  155.     </p>
  156.       </div>
  157.       <div class="simplesect" lang="en" xml:lang="en">
  158.         <div class="titlepage">
  159.           <div>
  160.             <div>
  161.               <h3 class="title"><a id="id3428647"></a>Different Kinds Of Script-Fus</h3>
  162.             </div>
  163.           </div>
  164.         </div>
  165.         <p>
  166.       There are two kinds of Script-Fus -- standalone scripts and
  167.       image-dependent scripts. You will find the standalone variants
  168.       under 
  169.       <span class="guimenu">Xtns</span>-><span class="guisubmenu">Script-Fu</span>-><span class="guimenuitem"><i class="replaceable"><tt>Type of Script</tt></i></span> in the main toolbox menu, 
  170.       and the image-dependent scripts are placed under 
  171.       <span class="guimenu">Script-Fu</span>-><span class="guimenuitem"><i class="replaceable"><tt>Type of Script</tt></i></span> in the image menu.
  172.     </p>
  173.       </div>
  174.       <div class="simplesect" lang="en" xml:lang="en">
  175.         <div class="titlepage">
  176.           <div>
  177.             <div>
  178.               <h3 class="title"><a id="id3428703"></a>Standalone Scripts</h3>
  179.             </div>
  180.           </div>
  181.         </div>
  182.         <p>
  183.       We will not try to describe every script in depth. Most
  184.       Script-Fus are very easy to understand and use. At the time of
  185.       this writing, the following types are installed by default:
  186.     </p>
  187.         <div class="itemizedlist">
  188.           <ul type="disc">
  189.             <li>
  190.               <p>
  191.         Patterns
  192.       </p>
  193.             </li>
  194.             <li>
  195.               <p>
  196.         Web page themes
  197.       </p>
  198.             </li>
  199.             <li>
  200.               <p>
  201.         Logos
  202.       </p>
  203.             </li>
  204.             <li>
  205.               <p>
  206.         Buttons
  207.       </p>
  208.             </li>
  209.             <li>
  210.               <p>
  211.         Utils
  212.       </p>
  213.             </li>
  214.             <li>
  215.               <p>
  216.         Make Brush
  217.       </p>
  218.             </li>
  219.             <li>
  220.               <p>
  221.         Misc.
  222.       </p>
  223.             </li>
  224.           </ul>
  225.         </div>
  226.         <div class="variablelist">
  227.           <dl>
  228.             <dt>
  229.               <span class="term">Patterns</span>
  230.             </dt>
  231.             <dd>
  232.               <p>
  233.         You will find all kinds of pattern-generating scripts
  234.         here. Generally, they are quite useful because you can add many
  235.         arguments to your own patterns.
  236.       </p>
  237.               <p>
  238.         We'll take a look at the Land script. In this script you have to
  239.         set the image/pattern size, and specify what levels of random to
  240.         use for your land creation. The colors used to generate the land
  241.         map are taken from the currently selected gradient in the
  242.         gradient editor. You must also supply values for the level of
  243.         detail, land and sea height/depth and the scale. Scale refers to
  244.         the scale of your map, just as in an ordinary road map, 1:10
  245.         will be typed as 10. 
  246.       </p>
  247.             </dd>
  248.             <dt>
  249.               <span class="term">Web Page Themes</span>
  250.             </dt>
  251.             <dd>
  252.               <p>
  253.         Here is clearly a practical use for scripts. By creating a
  254.         script for making custom text, logos, buttons arrows, etc., for
  255.         your web site, you will give them all the same style and
  256.         shape. You will also be saving a lot of time, because you don't
  257.         have to create every logo, text or button by hand. 
  258.       </p>
  259.               <p>
  260.         You will find the Gimp.org theme under the Web page theme
  261.         submenu. If you want to create your own theme, this script
  262.         will serve as an excellent template that you can modify to
  263.         create a theme for your web site. 
  264.       </p>
  265.               <p>
  266.       Most of the scripts are quite self-explanatory, but here are
  267.       some hints: 
  268.       </p>
  269.               <div class="itemizedlist">
  270.                 <ul type="disc">
  271.                   <li>
  272.                     <p>
  273.           Leave all strange characters like ' and " intact.
  274.         </p>
  275.                   </li>
  276.                   <li>
  277.                     <p>
  278.           Make sure that the pattern specified in the script exists.
  279.         </p>
  280.                   </li>
  281.                   <li>
  282.                     <p>
  283.           Padding refers to the amount of space around your text.
  284.         </p>
  285.                   </li>
  286.                   <li>
  287.                     <p>
  288.           A high value for bevel width gives the illusion of a higher button.
  289.         </p>
  290.                   </li>
  291.                   <li>
  292.                     <p>
  293.           If you type TRUE for "Press", the button will look pushed down.
  294.         </p>
  295.                   </li>
  296.                   <li>
  297.                     <p>
  298.           Choose transparency if you don't want a solid background. If
  299.           you choose a solid background, make sure it is the same
  300.           color as the web page background. 
  301.         </p>
  302.                   </li>
  303.                 </ul>
  304.               </div>
  305.             </dd>
  306.             <dt>
  307.               <span class="term">Logos</span>
  308.             </dt>
  309.             <dd>
  310.               <p>
  311.         Here you will find all kinds of logo-generating scrips. This
  312.         is nice, but use it with care, as people might recognize your
  313.         logo as being made by a known Gimp script. You should rather
  314.         regard it as a base that you can modify to fit your needs. The
  315.         dialog for making a logo is more or less the same for all such
  316.         scripts:
  317.       </p>
  318.               <div class="orderedlist">
  319.                 <ol type="1">
  320.                   <li>
  321.                     <p>
  322.           In the Text String field, type your logo name, like Frozenriver.
  323.         </p>
  324.                   </li>
  325.                   <li>
  326.                     <p>
  327.           In the Font Size text field, type the size of your logo in pixels.
  328.         </p>
  329.                   </li>
  330.                   <li>
  331.                     <p>
  332.           In the Font text field, type the name of the font that you
  333.           want to use for your logo. 
  334.         </p>
  335.                   </li>
  336.                   <li>
  337.                     <p>
  338.           To choose the color of your logo, just click on the color
  339.           button. This brings up a color dialog. 
  340.         </p>
  341.                   </li>
  342.                   <li>
  343.                     <p>
  344.           If you look at the current command field, you can watch the
  345.           script run. 
  346.         </p>
  347.                   </li>
  348.                 </ol>
  349.               </div>
  350.             </dd>
  351.             <dt>
  352.               <span class="term">Make Buttons</span>
  353.             </dt>
  354.             <dd>
  355.               <p>
  356.         Under this headline you'll find a script that makes beveled
  357.         buttons. The script has a dozen parameters or so, and most of
  358.         them are similar to those in the logo scripts. You can
  359.         experiment with different settings to come up with a button you
  360.         like. 
  361.       </p>
  362.             </dd>
  363.             <dt>
  364.               <span class="term">Utils</span>
  365.             </dt>
  366.             <dd>
  367.               <p>
  368.         Under Utils you will find a small but nice script: the Fontmap
  369.         script, which makes an image of your fonts. You will have to
  370.         type the names of the fonts you want displayed in the Fonts text
  371.         field. 
  372.       </p>
  373.               <p>
  374.         The Custom gradient script creates an image of the current
  375.         custom gradient in the gradient editor. This can be useful if
  376.         you want to pick colors from a gradient as in a palette. 
  377.       </p>
  378.             </dd>
  379.             <dt>
  380.               <span class="term">Misc.</span>
  381.             </dt>
  382.             <dd>
  383.               <p>
  384.         Under Misc. you'll find scripts that can be quite useful, but
  385.       aren't suitable for the other submenus. An example is the Sphere
  386.       script. You will have to set the radius in pixels to determine
  387.       the sphere size. The lighting angle is where at the sphere you
  388.       point the spotlight. This value also has an impact on the sphere
  389.       shadow. If you don't want a shadow, you will have to type
  390.       FALSE. The last thing you have to select is background color,
  391.       and the color of your sphere. 
  392.       </p>
  393.             </dd>
  394.             <dt>
  395.               <span class="term">Make Brush</span>
  396.             </dt>
  397.             <dd>
  398.               <p>
  399.         This script lets you make your own custom rectangular/circular
  400.         brushes, with or without feathered (blurred) edges. The script
  401.         will automatically store your brush in your 
  402.         personal brush directory. You just have to press refresh in the
  403.         Brush Selection dialog to use your newly created brush. 
  404.       </p>
  405.             </dd>
  406.           </dl>
  407.         </div>
  408.       </div>
  409.       <div class="simplesect" lang="en" xml:lang="en">
  410.         <div class="titlepage">
  411.           <div>
  412.             <div>
  413.               <h3 class="title"><a id="id3428948"></a>Image-Dependent Scripts</h3>
  414.             </div>
  415.           </div>
  416.         </div>
  417.         <p>
  418.       These are scripts that perform operations on an existing
  419.       image. In many ways they are like the plug-ins in the Filters
  420.       menu. The following script groups are installed by default: 
  421.     </p>
  422.         <div class="itemizedlist">
  423.           <ul type="disc">
  424.             <li>
  425.               <p>
  426.         Decor
  427.       </p>
  428.             </li>
  429.             <li>
  430.               <p>
  431.         Modify
  432.       </p>
  433.             </li>
  434.             <li>
  435.               <p>
  436.         Animators
  437.       </p>
  438.             </li>
  439.             <li>
  440.               <p>
  441.         Stencil Ops
  442.       </p>
  443.             </li>
  444.             <li>
  445.               <p>
  446.         Alchemy
  447.       </p>
  448.             </li>
  449.             <li>
  450.               <p>
  451.         Shadow
  452.       </p>
  453.             </li>
  454.             <li>
  455.               <p>
  456.         Render
  457.       </p>
  458.             </li>
  459.             <li>
  460.               <p>
  461.         Utils
  462.       </p>
  463.             </li>
  464.             <li>
  465.               <p>
  466.         Selection
  467.       </p>
  468.             </li>
  469.           </ul>
  470.         </div>
  471.         <div class="variablelist">
  472.           <dl>
  473.             <dt>
  474.               <span class="term">Stencil Ops</span>
  475.             </dt>
  476.             <dd>
  477.               <p>
  478.           Here, you'll find two scripts: Carve-It and Chrome-It, which
  479.           can render some truly nice artistic effects on grayscale
  480.           images. 
  481.         </p>
  482.             </dd>
  483.             <dt>
  484.               <span class="term">Drop Shadow</span>
  485.             </dt>
  486.             <dd>
  487.               <p>
  488.           Drop Shadow will cast a shadow behind your selected
  489.           object. It has three important parameters. X and Y offset
  490.           determine where the shadow will be placed in relation to the
  491.           selected object. Offset is measured in pixels. High values
  492.           make the shadow look like it's far away, and low values will
  493.           make it look closer to the object. The blur value is also
  494.           important, because a shadow that is cast far from the object
  495.           has a higher blur level. 
  496.         </p>
  497.             </dd>
  498.             <dt>
  499.               <span class="term">Perspective Shadow</span>
  500.             </dt>
  501.             <dd>
  502.               <p>
  503.           Perspective Shadow has a very important parameter: the
  504.           perspective angle. If this angle is set to 0 or 180, there
  505.           will be no shadow, because the script assumes that the object
  506.           has no thickness. This also means that this script looks fine
  507.           in certain angles, but unnatural in others. The other
  508.           parameters are quite self-explanatory. You'll get more blur if
  509.           the horizon is far away, and the shadow length is the length
  510.           in relation to the selected object. 
  511.         </p>
  512.             </dd>
  513.           </dl>
  514.         </div>
  515.       </div>
  516.     </div>
  517.     <div class="navfooter">
  518.       <hr />
  519.       <table width="100%" summary="Navigation footer">
  520.         <tr>
  521.           <td width="40%" align="left"><a accesskey="p" href="ch02s08s04.html">Prev</a>┬á</td>
  522.           <td width="20%" align="center">
  523.             <a accesskey="u" href="ch02.html">Up</a>
  524.           </td>
  525.           <td width="40%" align="right">┬á<a accesskey="n" href="ch02s10.html">Next</a></td>
  526.         </tr>
  527.         <tr>
  528.           <td width="40%" align="left" valign="top">8.4.┬áWriting Plugins┬á</td>
  529.           <td width="20%" align="center">
  530.             <a accesskey="h" href="index.html">Home</a>
  531.           </td>
  532.           <td width="40%" align="right" valign="top">┬á10.┬áA Script-Fu Tutorial</td>
  533.         </tr>
  534.       </table>
  535.     </div>
  536.   </body>
  537. </html>
  538.